package dao.proxy;



import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.util.List;
import dao.impl.IPersonDAO;
import dao.impl.IPersonDAOImpl;
import jdbc.DatabaseConnection;
import vo.Food;
import vo.Manager;


public class IPersonDAOProxy implements IPersonDAO{
	

private DatabaseConnection dbc=null;
private IPersonDAO dao=null;
public IPersonDAOProxy(){
	try{
		this.dbc=new DatabaseConnection();
		this.dao=new IPersonDAOImpl(this.dbc.getConnection());
	}catch(Exception e){
		
	}
	
	}

	public List<Food> findAllFood() throws Exception {
		// TODO Auto-generated method stub
		List<Food> stuList=null;
		try{
			stuList=this.dao.findAllFood();
		}catch(Exception e){
			throw e;
		}finally{
			this.dbc.close();
		}
		
		return stuList;
	}
	
	
	public boolean findManager(Manager user) throws Exception {
		boolean flag=false;
		try{
			flag=this.dao.findManager(user);
		}catch(Exception e){
			throw e;
		}finally{
			this.dbc.close();
		}
		
		return flag;
		
	
	}

}
